import {buildGetApiByType, buildPostApiByType} from '@/framework/apis'
import {apiType} from '@/apis/index'
import {request} from '@/framework/network/request'

const buildGetApi = (url: string) => buildGetApiByType(url, apiType.order)
const buildPostApi = (url: string) => buildPostApiByType(url, apiType.order)

export const orderOperate = (id: number | string, operate: string) =>
    request(buildPostApi('/operate'), {operate}, {id}, true) as Promise<any>
export const getOrderFsmConfig = () =>
    request(buildGetApi('/fsm'), {}, {}, true) as Promise<any>
